<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="http://stripes.sourceforge.net/stripes.tld" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsp/jstl/fmt" %>

<s:layout-render name="/frontend/layout.jsp" title="frontend.menu.advanced_search">
    <s:layout-component name="body">
        <s:useActionBean beanclass="cz.muni.fi.pa165.bookingmanager.web.FrontEndActionBean" var="actionBean"/>
        <div class="content_right_section">              
            <div class="content_title_01"><f:message key="frontend.menu.advanced_search" /></div>                        
            <br />
            <p><f:message key="frontend.advanced_search.text" /></p>
            <s:form action="/frontend/advancedSearching" method="post">                
                <table width="100%">
                    <tr>
                        <th><f:message key="frontend.quick_search.minCapacity" /></th>
                        <td>
                            <s:text name="minCapacity" />  
                            <s:errors field="minCapacity">
                            <s:errors-header><ul></s:errors-header>
                            <li><s:individual-error /></li>
                            <s:errors-footer></ul></s:errors-footer>
                        </s:errors>
                        </td>
                    </tr>
                    <tr>
                        <th><f:message key="frontend.quick_search.maxPrice" /></th>
                        <td>
                            <s:text name="maxPrice" />
                            <s:errors field="maxPrice">
                            <s:errors-header><ul></s:errors-header>
                            <li><s:individual-error /></li>
                            <s:errors-footer></ul></s:errors-footer>
                        </s:errors>
                        </td>
                    </tr>
                    <tr>
                        <th><f:message key="entities.room.hotel" /></th>
                        <td>
                            <s:select name="hotel.id">
                                <s:options-collection collection="${actionBean.getListHotels()}" value="id" label="name" />
                            </s:select> 
                        </td>
                    </tr>
                    <tr>
                        <th><f:message key="frontend.global.arrival" /></th>
                        <td>
                            <s:select name="day">
                                <c:forEach var="i" begin="1" end="31">                                
                                    <s:option value="${i}" >${i}</s:option>
                                </c:forEach>
                            </s:select>                            
                            <s:select name="month">
                                <c:forEach var="i" begin="1" end="12">                                
                                    <s:option value="${i}" >${i}</s:option>
                                </c:forEach>
                            </s:select>
                            <s:select name="year">
                                <c:forEach var="i" begin="2012" end="2030">                                
                                    <s:option value="${i}" >${i}</s:option>
                                </c:forEach>
                            </s:select>                            
                        </td>
                    </tr>
                    <tr>
                        <th><f:message key="entities.reservation.duration" /></th>
                        <td>
                            <s:text name="duration" />
                            <s:errors field="duration">
                            <s:errors-header><ul></s:errors-header>
                            <li><s:individual-error /></li>
                            <s:errors-footer></ul></s:errors-footer>
                        </s:errors>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" align="center"><br /><s:submit name="advancedSearching" ><f:message key="global.submit" /></s:submit></td>
                    </tr>
                </table>
             </s:form>                            
       	</div>
        <div class="cleaner_h40">&nbsp;</div>
        
        
    </s:layout-component>
</s:layout-render>

